package com.nxuer.controllers.pkg01;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;

@RestController
@RequestMapping("/RestfulApi")
public class HistoryData {
    @Resource
    Dao dao;
    @GetMapping("/History/{date}")
    String hd(@PathVariable int date) {
        ArrayList<MeteData> meteData = dao.QueryMeteData(date);
        return JSON.toJSONString(meteData);
    }
}
